#include <iostream>
using namespace std;

/*
    运算符重载，解决学生结构体不能做乘法的问题
*/

struct Student
{
    string name;
    int age;

    int operator*(struct Student &s)
    {
        return age * s.age;
    }
};

template <typename T>
void fun(T n)
{
    cout << n * n << endl;
}

int main()
{
    Student s = {"tom", 30};

    fun(s);
    fun(10);
}